package com.example.web.controller;
import com.example.web.SysConst;
import com.example.web.dto.*;
import com.example.web.dto.query.*;
import com.example.web.entity.*;
import com.example.web.mapper.*;
import com.example.web.service.*;
import com.example.web.tools.dto.*;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import lombok.SneakyThrows;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.util.*;
import java.util.stream.Collectors;

/**
 * 物品收藏控制器
 */
@RestController()
@RequestMapping("/GoodLove")
public class GoodLoveController {
    @Autowired()
    private  GoodLoveService _GoodLoveService;
    @Autowired()
    private GoodLoveMapper _GoodLoveMapper;
    /**
     * 物品收藏分页查询
     */
    @RequestMapping(value = "/List", method = RequestMethod.POST)
    @SneakyThrows
    public PagedResult<GoodLoveDto> List(@RequestBody GoodLovePagedInput input)  {
        return _GoodLoveService.List(input);
    }
     /**
     * 单个物品收藏查询接口
     */
    @RequestMapping(value = "/Get", method = RequestMethod.POST)
    @SneakyThrows
    public GoodLoveDto Get(@RequestBody GoodLovePagedInput input) {

        return _GoodLoveService.Get(input);
    }

    /**
     * 物品收藏创建或则修改
     */
    @RequestMapping(value = "/CreateOrEdit", method = RequestMethod.POST)
    public GoodLoveDto CreateOrEdit(@RequestBody GoodLoveDto input) throws Exception {
        return _GoodLoveService.CreateOrEdit(input);
    }
    /**
     * 物品收藏删除
     */
    @RequestMapping(value = "/Delete", method = RequestMethod.POST)
    public void Delete(@RequestBody IdInput input)
    {
        _GoodLoveService.removeById(input.getId());
    }

    /**
     * 物品收藏批量删除
     */
    @RequestMapping(value = "/BatchDelete", method = RequestMethod.POST)
    public void BatchDelete(@RequestBody IdsInput input)
    {
        _GoodLoveService.removeByIds(input.getIds());
    }


}
